ztreasureislefandomcom-20200214-history
Help:AutoTreasure
AutoTreasure is a Template that can be used to display a set of Treasures associated with a Map. Auto Treasure was developed to make adding Treasures to new Map articles quick and easy. How It Works AutoTreasure works by calling a few other Templates that behave like a database. Those databases have lines of parameters which hold all the information for a particular map or collection. Here are some examples: *An excerpt from Template:GetMapData: |Guarded Shores=replay 15%level 5%theme tiki%reward 75%collections Koa Wood Statues,Hula Outfit,Historical Sculptures |Glimmering Shoals=replay 10%level 6%theme tiki%reward 55%collections Sailing Instruments,Hula Outfit,Historical Sculptures |Bikini Beach=replay 15%level 12%theme tiki%reward 75%collections Coral Jewelry Collection,Treasure Remnants,Lost Fine Art *An excerpt from Template:GetCollectionData: |Koa Wood Statues=group tiki%rarity Common%reward 1000 Coins%xp 30%collectables Marlin,Shark,Turtle,Whale,Mahi Mahi |Hula Outfit=group tiki%rarity Uncommon%reward 2500 Coins%xp 60%collectables Skirt,Lei,Anklet,Wristlet,Headdress |Alepoi's Beach Gear=group tiki%rarity Uncommon%reward 2500 Coins%xp 60%collectables Surfboard,Paddle,Outrigger,Surf Amulet,Beach Mat By using other Templates such as Template:GetParameter and Template:GetSubParameter the user can grab data out of these databases just by supplying a few simple parameters. Example1: Get the information for the map "Pearl Caves" from the Atlantis series Output: " " Example2: Get the information for the collection "Lost Dive Gear" Output: " " By calling these two functions for any collection, AutoTreasure can automatically calculate all the information it needs to produce a list or graphical output for a collection. Example3: Run AutoTreasure for the collection "Lost Dive Gear" Output: As you can see by running your cursor over the collectibles, a hover box shows over each item. This is the Template:TreasureHover, which can be used elsewhere if needed. AutoTreasure Layout AutoTreasure is able to output 2 different views, based on the display parameter. If you like the look of the output in Example3 above, the display parameter was set to "Line". If you want a more box-shaped output similar to how collections are displayed in the game, simply change the display parameter to "Block". Example4: Run AutoTreasure for the collection "Lost Dive Gear" using display=Block Output: Mass Output AutoTreasure can be taken one step further by making use of the Template:GetMapData. By calling another Template:AutoTreasuresByMap we can grab the entire list of collections for the given map and display them all at once. Example5: Run AutoTreasuresByMap for the map "Pearl Caves" using display=Line Output: In addition to the "Block" and "Line" output options given by Template:AutoTreasure, Template:AutoTreasuresByMap can instead take a listonly parameter. If listonly=1, the output will be a simple list of collection links separated by newlines ( ). Example6: Run AutoTreasuresByMap for the map "Pearl Caves" using listonly=1 Output: This list can come in handy for filling Infobox structures. In addition to the simple link list, the user can also build a list of collection icons. Example7: Run AutoTreasuresByMap for the map "Pearl Caves" using listonly=1 and display=Icon Output: Not-So-Mass Output The actual function that draws out the graphical collection box is Template:FxTreasureSet which in turn calls one of two other templates to draw in "Line" or "Block" format. The Template:AutoTreasure relies on a total of 4 database templates to work properly, and if nobody is keeping those databases up to date, a user may wish to enter the collection data manually. If the user wanted to do such a thing they would simply fill out the entire Template:FxTreasureSet body and make changes as needed. Example8: Manually filling a FxTreasureSet Template (incomplete view) Output: As you can see, an incomplete treasure set is very ugly, but it helps the user to see what is missing. In the case that the graphics you supplied are missing, you will immediately see that, and if the file is missing, you have the option to click the link and fill in the image right on the template. To Make changes to the template above, it is easiest to just click on the edit link for the section, which should appear near the Example 8 '''heading. When the edit screen comes up, you can simply hover your cursor over the icon for the template and click the '''edit option. This Wiki has very good built in editing software for templates and it really makes filling in templates easy, as long as you have the information at hand to enter in. Keep in mind that you can supply other templates as parameters for templates. For instance, you can enter to get the current known description for the Underwater Camera collectible. The output would be " " Other Templates I have created a large list of templates just to get this graphical output to load quickly. Previous attempts with all the information bundled into a single template failed horribly because of all the repetitive calls to the database templates. By using multi-level templates I have achieved a much more fluid and speedy output. Future versions may be even faster. Here is a list of all the templates used to create these collection boxes: Template List *Template:AutoTreasure (edit) : Automatically draws a single collection *Template:AutoTreasureSub1 (edit) : Required by AutoTreasure *Template:AutoTreasuresByMap (edit) : Automatically draws all collections for a single map *Template:AutoTreasuresByMapSub1 (edit) : Required by AutoTreasuresByMap *Template:Eq (edit) : Returns "=" which comes in handy when you pass data containing = to a template that cannot understand it. Notice the parameters in the database templates are separated with this template instead of "=". *Template:FxTreasureSet (edit) : Draws a single collection by manual input of all info *Template:FxTreasureSetBlock (edit) : Required by FxTreasureSet *Template:FxTreasureSetLine (edit) : Required by FxTreasureSet *Template:GetCollectionData (edit) : Reads a database line for a single collection *Template:GetMapData (edit) : Reads a database line for a single map *Template:GetParameter (edit) : Returns the value of a parameter in a % delimited string *Template:GetSubParameter (edit) : Returns the value of an array index inside a % delimited string *Template:GetTDesc (edit) : Returns the description of a collection item, this is another database *Template:GetTIcon (edit) : Creates an icon for a treasure by its name, automatically adding (collection) if needed and causing the icon to link back to the appropriate collection article *Template:GetTLink (edit) : Creates a link for a treasure by its name, automatically adding (collection) if needed *Template:GetTNeedsAlt (edit) : Determines yes or no if a collection needs to have (collection) in its name to make a viable link *Template:NoSpaces (edit) : Removes all spaces from a string *Template:TreasureHover (edit) : Draws a box with descriptive information when you mouseOver any collection item